#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QInputDialog>
#include <QDebug>
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_pushButton_clicked()
{
    int in = QInputDialog::getInt(this,"整数输入","请输入一个整数");
    qDebug() << in;
}

void MainWindow::on_pushButton_2_clicked()
{
    double d = QInputDialog::getDouble(this,"浮点数输入","请输入一个小数");
    qDebug() << d;
}

void MainWindow::on_pushButton_3_clicked()
{
    QStringList items;
    items.push_back("国色天香");
    items.push_back("怀昔蕊");
    items.push_back("等一个晚安");
    QString res = QInputDialog::getItem(this,"选项输入","请输入/选择",items);
    qDebug() << res;
}
